﻿function view_onOpen() {

edit1.value = '';
edit2.value = '';
edit3.value = '';

}

function button1_onclick() {
	var value1= '/K';

	if(checkbox1.value)
	{
		value1 = value1 + '  net start ' + edit1.value + ' & ';
	}

	if(checkbox2.value)
	{
		value1 = value1 +   '  net start ' + edit2.value + ' & ';
	}
	if(checkbox3.value)
	{
		value1 = value1 +   '  net start ' + edit3.value + ' & ';
	}
	if(checkbox1.value || checkbox2.value || checkbox3.value)
	{
			value1 = value1 +  'exit';
			var winShell = new ActiveXObject('Shell.Application'); 
			winShell.ShellExecute('cmd.exe', value1); 
	}
}
function button2_onclick() {
	var value1= '/K';

	if(checkbox1.value)
	{
		value1 = value1 + '  net stop ' + edit1.value + ' & ';
	}

	if(checkbox2.value)
	{
		value1 = value1 +   '  net stop ' + edit2.value + ' & ';
	}
	if(checkbox3.value)
	{
		value1 = value1 +   '  net stop ' + edit3.value + ' & ';
	}
	if(checkbox1.value || checkbox2.value || checkbox3.value)
	{
			value1 = value1 +  'exit';
			var winShell = new ActiveXObject('Shell.Application'); 
			winShell.ShellExecute('cmd.exe', value1); 
	}
}
